﻿using Microsoft.Extensions.Logging;
using Quartz;
using System;
using System.Threading.Tasks;

namespace H2O.Jobs
{
    /// <summary>
    /// 打个招呼作业
    /// </summary>
    public class HelloJob : IJob
    {
        private readonly ILogger _logger;

        public HelloJob(ILogger<HelloJob> logger)
        {
            _logger = logger;
        }

        public Task Execute(IJobExecutionContext context)
        {            
            _logger.LogInformation(message: $"Hello from {nameof(HelloJob)} {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
            return Task.FromResult(result: true);
        }
    }
}
